<HTML><HEAD><TITLE>card_labeling(?SetVars)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">library(cardinal)</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>card_labeling(?SetVars)</H1>
Label cardinality of set variables
<DL>
<DT><EM>SetVars</EM></DT>
<DD>A list of set variables.
</DD>
</DL>
<H2>Description</H2>
Instantiate all cardinalities of variables in SetVars from first to
		last, using indomain/1 predicate of fd library.<P>
		card_labeling/1 is defined as:
<PRE>
  card_labeling([]).
  card_labeling([H|T]):-
	cardinality(H, C),
	indomain(C),
	card_labeling(T).
</PRE>

<H3>Fail Conditions</H3>
Fails if cardinalities of SetVars can not be labeled (because constraint
		propagation leads to a failure).
<H3>Resatisfiable</H3>
Yes.
<H2>Examples</H2>
<PRE>
?- S `:: [a]+[b,c]:CS, T `:: [1] + [2], card_labeling([S, T]).
CS = 1, S = [a], T = [1] ;
CS = 1, S = [a], T = [1, 2] ;
CS = 2, T = [1] ;
CS = 2, T = [1, 2] ;
CS = 3, S = [a,b,c], T = [1] ;
CS = 3, S = [a,b,c], T = [1, 2] ;
no

?- S `:: [a] + [b,c,d,e,f]:[2,3,6,9], card_labeling([S]), cardinality(S,C).
C = 2 ;
C = 3 ;
C = 6, S = [a,b,c,d,e,f] ;
no

</PRE>
<H2>See Also</H2>
<A HREF="../../lib_public/cardinal/set_labeling-2.html">set_labeling / 2</A>, <A HREF="../../lib_public/cardinal/refine-2.html">refine / 2</A>, <A HREF="../../lib_public/cardinal/cardinality-2.html">cardinality / 2</A>
</BODY></HTML>
